package com.swanclouds.redfish.managers.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swanclouds.model.DeviceEntity;
import java.util.Map;

public class HttpsCertModel implements DeviceEntity {
    //安全服务集合资源节点的访问路径
    @JsonProperty("@odata.id")
    private String dataId;

    //安全服务集合资源的OData描述信息
    @JsonProperty("@odata.context")
    private String context;

    //安全服务集合资源的类型
    @JsonProperty("@odata.type")
    private String type;

    //安全服务集合资源的ID
    @JsonProperty("Id")
    private String id;

    //安全服务集合资源的名称
    @JsonProperty("Name")
    private String name;

    //SSL证书信息
    @JsonProperty("X509CertificateInformation")
    private Map<String,Object> x509CertificateInformation;

    /**
     * CSR信息 说明
     * 导入服务器证书后，之前生
     * 成的CSR信息清除，此处显
     * 示为“null”。
     */
    @JsonProperty("CertificateSigningRequest")
    private String certificateSigningRequest;

    //可执行的操作
    @JsonProperty("Actions")
    private Map<String,Object> actions;

    @Override
    public String getDataId() {
        return dataId;
    }

    @Override
    public String getContext() {
        return context;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        }catch (JsonProcessingException e){
        }
        return "HttpsCertModel{" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", x509CertificateInformation=" + x509CertificateInformation +
                ", certificateSigningRequest='" + certificateSigningRequest + '\'' +
                ", actions=" + actions +
                '}';
    }
}
